package com.nondo.rdp.finance.domain;

import com.nondo.rdp.auth.domain.User;
import com.nondo.rdp.core.domain.base.BaseEntity;
import com.nondo.rdp.finance.config.DbConfig;

import javax.persistence.*;

/**
 * 用户关注表
 */
@Entity
@Table(name = DbConfig.DEFAULT_TABLE_PREFIX + "userFollow")
public class UserFollow extends BaseEntity {
    public static final Integer STATUS_FOLLOW = 0;
    public static final Integer STATUS_CANCEL = 1;

    private Long id;    //自增ID
    private User follower;//被关注者
    private User user;//关注者
    private int status;// 0=关注，1=取消

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "fuid")
    public User getFollower() {
        return follower;
    }

    public void setFollower(User follower) {
        this.follower = follower;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "uid")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }
}
